<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>NFA</title>


        <script type="text/javascript" src="http://localhost:8080/nfa/js/jquery-2.1.1.min.js"></script>
        <link rel="stylesheet" type="text/css" href="http://localhost:8080/nfa/css/bootstrap.css" />
        <link rel="stylesheet" type="text/css" href="http://localhost:8080/nfa/css/style.css" />
        <link rel="stylesheet" type="text/css" href="http://localhost:8080/nfa/css/bootstrap-theme.css"  />
        <script type="text/javascript" src="http://localhost:8080/nfa/js/bootstrap.js"></script>

        <script type="text/javascript" src="http://localhost:8080/nfa/js/jquery.validate.js"></script>
        <script type="text/javascript" src="http://localhost:8080/nfa/js/messages_vi.js"></script>
        <script type="text/javascript" src="http://localhost:8080/nfa/js/js.js"></script>
        <script type="text/javascript" src="http://localhost:8080/nfa/js/popbox.js"></script>
        <script type="text/javascript" src="http://localhost:8080/nfa/js/autoload.js"></script>
        <script type='text/javascript' charset='utf-8'>
            $(document).ready(function() {
                $('.popbox').popbox();


            });
        </script>


    </head>

    <?php
    $image = $this->connect->getinfo($this->session->userdata("email"));
    foreach ($image as $i) {
        $avarta = $i->avarta;
        $ten = $i->name;
        $truong = $i->education;
        $city = $i->city;
        $stt = $i->status;
        $cao = $i->height;
        $nang = $i->weight;
        $toi = $i->about_me;
        $ban = $i->about_you;
        $tim = $i->find_age;
        $mucdich = $i->target;
        $gt = $i->gender;
        $dotuoi = $i->find_age;
    }
    ?>
    <body onload="updateAlerts();
                updateconversations();
                updateRequest();
                getRequest();
                loadnotice();
                updatenotice();">

        <!-- header -->
        <header>
            <nav class="navbar navbar-fixed-top navbar-default" role="navigation" style="height:50px !important ;">
                <div class="center">	
                    <div class="container-fluid">
                        <!-- Brand and toggle get grouped for better mobile display -->
                        <div class="navbar-header" style="width: 8%;">

                            <a class="navbar-brand" href="#" style=" font-size:30px; color:#F06; ;">NFA</a>
                        </div>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div>
                            <div >
                                <ul class="nav navbar-nav" style=" width: 20%;">

                                    <li class="notice">


                                        <div class='popbox'>

                                            <div  style="text-align: center;" class='open'  >
                                                <span  class="glyphicon glyphicon-user"><span id="request" class="badge"></span></span>
                                            </div>


                                            <div class='collapse-one'>
                                                <div class='box' >
                                                    <div class='arrow'></div>
                                                    <div class='arrow-border'></div>

                                                    <div class="popbox-content">
                                                        <div class="popbox-header">Yêu cầu kết bạn</div>
                                                        <div class="popbox-data">
                                                            <ul id="friend-request">

                                                            </ul>
                                                        </div>
                                                        <div class="popbox-footer">
                                                            <a href="#">Xem tất cả</a>
                                                        </div>
                                                    </div>


                                                </div>
                                            </div>
                                        </div>



                                    </li>
                                    <li class="notice">
                                        <a class='open' data-toggle="modal" data-target="#inbox">
                                            <span class="glyphicon glyphicon-comment"><span id="count-message" class="badge"></span></span>
                                        </a>
                                    </li>
                                    <li class="notice">


                                        <div class='popbox' >
                                            <div  style="text-align: center;" class='open'  >

                                                <span class="glyphicon glyphicon-exclamation-sign"><span id="count-notice" class="badge"></span></span>

                                            </div>

                                            <div class='collapse-one'>
                                                <div class='box' >
                                                    <div class='arrow'></div>
                                                    <div class='arrow-border'></div>

                                                    <div class="popbox-content">
                                                        <div class="popbox-header">Bảng tin</div>
                                                        <div class="popbox-data">
                                                            <ul id="notice">

                                                            </ul>
                                                        </div>
                                                        <div class="popbox-footer">
                                                            <a href="#">Xem tất cả</a>
                                                        </div>
                                                    </div>


                                                </div>
                                            </div>
                                        </div>

                                    </li>

                                </ul>
                            </div>
                            <div style="height: 0;" >
                                <form id="sb"  style="padding-top: 0.7%;" method="get" action="http://localhost:8080/nfa/index.php/search/searchquick">
                                    <div class="input-group" style="width:40%;">
                                        <input autocomplete="off" type="text"  id="keywords" name="kw"  class="form-control" placeholder="Tìm kiếm tên hoặc email ...." />
                                        <span class="input-group-btn">
                                            <button id="btn-search" class="btn btn-success" type="submit">Tìm kiếm</button>
                                        </span>
                                    </div>
                                    <div  id="results" style="width:40%; margin-left: 28%;">

                                    </div>


                                </form><!-- /.col-lg-6 -->
                            </div>
                            <div style="float: right;">
                                <ul class="nav navbar-nav" >
                                    <?php if ($this->session->userdata('email')) { ?>
                                        <li class="notice"><a href="http://localhost:8080/nfa/index.php/home/mypage"><img src="http://localhost:8080/nfa/images/avarta/<?php echo $avarta; ?>" class="notice-area"  /> <?php echo $ten; ?></a></li>
                                    <?php } else { ?>
                                        <li class="notice"><a href="http://localhost:8080/nfa/index.php/home/mypage"><img src="http://localhost:8080/nfa/images/avarta/user_male4.png" class="notice-area"  /> <?php echo $ten; ?></a></li>

                                    <?php } ?> 
                                    <li class="notice">
                                        <a href="http://localhost:8080/nfa/index.php/home">Home</a>
                                    </li>
                                    <li class="dropdown notice">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-cog"></span> <b class="caret"></b></a>
                                        <ul class="dropdown-menu">
                                            <li><a href="">Thiết lập</a></li>
                                            <li><a href="http://localhost:8080/nfa/index.php/login/logout">Thoát</a></li>

                                        </ul>
                                    </li>

                                </ul>
                            </div>
                        </div><!-- /.navbar-collapse -->
                    </div><!-- /.container-fluid -->
                </div>
            </nav>
        </header>

        <!-- message -->

        <div class="modal fade" id="inbox" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel"> Tin nhắn</h4>
                    </div>

                    <div class="modal-body">
                        <div class="row">
                            <div class="col-xs-6 col-md-4" style="overflow : auto;" >
                                <ul id="coversations" class="list-group">

                                </ul>
                                <p id="typing"></p>
                            </div>
                            <div class="col-xs-12 col-md-8">
                                <div class="panel panel-default">
                                    <div class="panel-body" id="ob" style="height: 380px; overflow : auto;" >
                                        <ul id="tinnhan">

                                        </ul>
                                    </div>
                                    <div class="panel-footer" >
                                        <form id="chat-box" method="post">

                                            <input type="hidden" name="id" value="" id="id-chat"/>
                                            <textarea name="chat" id="chatchit" class="form-control"   rows="3"></textarea> 

                                        </form>

                                    </div>
                                </div>
                                <p style="float: right; font-weight: bold;"><span class="glyphicon glyphicon-ok-circle"></span> Nhấn enter để gửi</p>
                            </div>
                        </div>
                    </div>


                </div>
            </div>
        </div> 



        <div class="center">
            <div class="row" style="padding-top:60px;">

                <div class="col-xs-6 col-md-4">
                    <div class="panel panel-info">
                        <h4 style="text-align: center;"> <img src="http://localhost:8080/nfa/images/1399832230_red-21.png" style="margin-right:5%;"/>Thành viên phù hợp với bạn </h4>
                        <div class="panel-body">
                            <ul class="list">
                                <?php
                                $from = substr($dotuoi, 5, 2);
                                $to = substr($dotuoi, 8, 2);
                                $e = $this->connect->getgoiy($gt, $city, $mucdich, $from, $to);
                                foreach ($e as $i) {
                                    $anh = $i->avarta;
                                    $id = $i->user_id;
                                    $ten = $i->name;
                                    ?>
                                    <a class="open" href="<?php echo base_url('getID?id=' . $id); ?>" class="goiy2"  data-toggle="tooltip" data-placement="top" title="<?php echo $ten; ?>" >
                                        <li class ="listjoin">
                                            <img class= "one anhnho4 img-thumbnail"  src="http://localhost:8080/nfa/images/avarta/<?php echo $anh; ?> "/>
                                        </li>
                                    </a>
                                    <?php
                                }
                                ?>
                            </ul>
                        </div>

                    </div>
                    <div class="panel panel-primary">
                        <div class="panel-heading">CUỘC HẸN GẦN NHẤT</div>
                        <div class="panel-body">
                            <ul style="padding-left: 0;">
                                <?php
                                $q = $this->connect->getfirstdating();
                                foreach ($q as $i) {
                                    $id_dating = $i->dating_id;
                                    $id_create = $i->user_id1;
                                    $datingname = $i->dating_name;
                                    $description = $i->description;
                                    $target = $i->target;
                                    $date = $i->date_dating;
                                    $hours = $i->hours;
                                    $minute = $i->minute;
                                    $address = $i->address;

                                    $time = date("d-m-Y", strtotime($date));
                                    $b = $this->connect->getID($id_create);
                                    foreach ($b as $z) {
                                        $avarta = $z->avarta;
                                        $name = $z->name;
                                        $old = $z->age;
                                        $thanhpho = $z->city;
                                    }
                                    ?>


                                    <li class="dating" >
                                        <div style="float: left; width: 20%;">
                                            <a href="<?php
                                            if ($id_create == $this->session->userdata('id')) {
                                                echo base_url("home/mypage");
                                            } else {
                                                echo base_url("getid?id=" . $id_create);
                                            }
                                            ?>
                                               ">
                                                <img class='anhnho4  img-thumbnail' src="http://localhost:8080/nfa/images/avarta/<?php echo $avarta; ?>" />
                                            </a>
                                        </div>
                                        <div style="float: left; width: 80%; padding-left: 2%;">
                                            <a class="open" href="<?php echo base_url('dating/getdating?id=' . $id_dating); ?>"><?php echo $datingname; ?></a> <br/>
                                            <b> Hẹn bởi :</b><?php echo $name; ?>,<?php echo $old; ?> tuổi <br/>

                                            <b> Hẹn với : </b><?php echo $target; ?> <br/>
                                            <b>Mô tả : </b> <p class="short-text"><?php echo $description; ?> </p>


                                        </div>


                                    </li>

                                    <?php
                                }
                                ?>
                            </ul>
                            <center>
                                <a href="<?php echo base_url('dating'); ?>" class="btn btn-primary">Hẹn hò ngay</a>
                            </center>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-md-8">

                    <div class="panel panel-info" >
                        <div class="panel-heading">TÌM KIẾM </div>
                        <div class="panel-body">
                            <div id="search1">
                                <form class="form-horizontal" role="form" method="get" action="http://localhost:8080/nfa/index.php/search/search1">
                                    <div  class="form-group">
                                        <div class="radio-inline">
                                            <label> Bạn cần tìm :</label>
                                        </div>

                                        <div class="radio-inline">
                                            <label>
                                                <input type="radio" name="gender" id="optionsRadios1" value="Nam" checked/>
                                                Nam
                                            </label>
                                        </div>
                                        <div class="radio-inline">
                                            <label>
                                                <input type="radio" name="gender" id="optionsRadios2" value="Nữ"/>
                                                Nữ </label>
                                        </div>

                                        <div class="radio-inline">
                                            <label> Tuổi từ :</label>
                                        </div>
                                        <div class=" radio-inline">
                                            <select name="age-one" class="form-control">
                                                <option>18</option>
                                                <option>20</option>
                                                <option>25</option>
                                                <option>30</option>
                                                <option>40</option>
                                            </select>
                                        </div>
                                        <div class="radio-inline">
                                            <label> Đến </label>
                                        </div>
                                        <div class=" radio-inline">
                                            <select name="age-two" class="form-control">
                                                <option>20</option>
                                                <option>25</option>
                                                <option>30</option>
                                                <option>40</option>
                                                <option>50</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="radio">
                                            <label><b> Sống tại :</b></label>
                                        </div >
                                        <br />
                                        <div class="col-md-8  ">

                                            <select name="city" class="form-control">
                                                <option>Hà Nội</option>
                                                <option>TP.Hồ Chí Minh</option>
                                                <option>Đà Nẵng</option>
                                                <option> Huế </option>
                                                <option> Dak Lak</option>
                                            </select>

                                        </div>

                                    </div>
                                    <div class="row" style=" padding-left:3%; margin-bottom: 2%;">
                                        <button type="submit" id="tim" class="btn btn-success btn-lg ">Tìm kiếm</button>
                                        <a class="open" id="search2-on" style="padding-left: 3%;"><span class="glyphicon glyphicon-search"></span>Tìm kiếm nâng cao</a>

                                        <a href="<?php echo base_url('search/searchcity') ?>" style="float: right; margin-right: 3%;" class="btn btn-warning btn-lg "><span class="glyphicon glyphicon-globe"></span> Tìm bạn xung quanh tôi</a>
                                    </div>
                                </form>
                            </div>
                            <div id="search2" style="display: none;">
                                <form class="form-horizontal" role="form" method="get" action="http://localhost:8080/nfa/index.php/search/searchpage">
                                    <div  class="form-group">
                                        <div class="radio-inline">
                                            <label> Bạn cần tìm :</label>
                                        </div>

                                        <div class="radio-inline">
                                            <label>
                                                <input type="radio" name="gender" id="optionsRadios1" value="Nam" checked/>
                                                Nam
                                            </label>
                                        </div>
                                        <div class="radio-inline">
                                            <label>
                                                <input type="radio" name="gender" id="optionsRadios2" value="Nữ"/>
                                                Nữ </label>
                                        </div>

                                        <div class="radio-inline">
                                            <label> Tuổi từ :</label>
                                        </div>
                                        <div class=" radio-inline">
                                            <select name="age-one" class="form-control">
                                                <option>18</option>
                                                <option>20</option>
                                                <option>25</option>
                                                <option>30</option>
                                                <option>40</option>
                                            </select>
                                        </div>
                                        <div class="radio-inline">
                                            <label> Đến </label>
                                        </div>
                                        <div class=" radio-inline">
                                            <select name="age-two" class="form-control">
                                                <option>20</option>
                                                <option>25</option>
                                                <option>30</option>
                                                <option>40</option>
                                                <option>50</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="radio">
                                            <label><b> Sống tại :</b></label>
                                        </div >
                                        <br />
                                        <div class="col-md-8  ">

                                            <select name="city" class="form-control">
                                                <option>Hà Nội</option>
                                                <option>TP.Hồ Chí Minh</option>
                                                <option>Đà Nẵng</option>
                                                <option> Huế </option>
                                                <option> Dak Lak</option>
                                            </select>

                                        </div>

                                    </div>
                                    <div class="form-group">
                                        <div class="radio-inline">
                                            <label>Mục đích hẹn hò :</label>
                                        </div>
                                        <div class="radio-inline">
                                            <select name="mucdich" class="form-control">
                                                <option>Hôn nhân</option>
                                                <option>Tình yêu</option>
                                                <option>Tình dục</option>
                                                <option>Tiền bạc</option>
                                                <option>Hẹn hò</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group" >

                                        <div class="">

                                            <div class="radio-inline">
                                                <label> Chiều cao từ :</label>
                                            </div>
                                            <div class=" radio-inline">
                                                <select name="height-one" class="form-control">
                                                    <option>140</option>
                                                    <option>150</option>
                                                    <option>160</option>
                                                    <option>170</option>
                                                    <option>180</option>
                                                </select>
                                            </div>
                                            <div class="radio-inline">
                                                <label> Đến </label>
                                            </div>
                                            <div class=" radio-inline">
                                                <select name="height-two" class="form-control">
                                                    <option>150</option>
                                                    <option>160</option>
                                                    <option>170</option>
                                                    <option>180</option>
                                                    <option>190</option>
                                                </select>

                                            </div>
                                            <div class="radio-inline">
                                                <p>CM</p>
                                            </div>

                                        </div>

                                    </div>
                                    <div class="form-group" >

                                        <div class="">

                                            <div class="radio-inline">
                                                <label> Cân nặng từ :</label>
                                            </div>
                                            <div class=" radio-inline">
                                                <select name="weight-one" class="form-control">
                                                    <option>40</option>
                                                    <option>50</option>
                                                    <option>60</option>
                                                    <option>70</option>
                                                    <option>80</option>
                                                </select>
                                            </div>
                                            <div class="radio-inline">
                                                <label> Đến </label>
                                            </div>
                                            <div class=" radio-inline">
                                                <select name="weight-two" class="form-control">
                                                    <option>50</option>
                                                    <option>60</option>
                                                    <option>70</option>
                                                    <option>80</option>
                                                    <option>90</option>
                                                </select>

                                            </div>
                                            <div class="radio-inline">
                                                <p >Kg</p>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="row" style="text-align:center; margin-bottom: 2%;">
                                        <button type="submit" id="tim" class="btn btn-success btn-lg ">Tìm kiếm</button>
                                    </div>
                                </form>
                            </div>
                        </div>

                    </div>
                    <ul class="nav nav-tabs" id="tab-one" >
                        <li class="active" ><a href="#home" data-toggle="tab" >Mới gia nhập</a></li>

                        <li><a href="#messages" data-toggle="tab">Trai xinh</a></li>
                        <li><a href="#settings" data-toggle="tab">Gái đẹp</a></li>
                    </ul>
                    <div class="tab-content">

                        <div class="tab-pane fade in active " id="home">
                            <ul class="list">
                                <?php
                                $a = $this->connect->getmoigianhap();
                                foreach ($a as $i) {
                                    $anh = $i->avarta;
                                    $id = $i->user_id;
                                    $ten = $i->name;
                                    ?>
                                <a class="open" href="<?php echo base_url('getID?id=' . $id); ?>" id="goiy"  data-toggle="tooltip" data-placement="top" title="<?php echo $ten; ?>" >

                                        <li class ="listjoin">
                                            <img class= "one anhnho6 img-thumbnail"  src="http://localhost:8080/nfa/images/avarta/<?php echo $anh; ?> "/>
                                        </li>
                                    </a>
                                    <?php
                                }
                                ?>
                            </ul>
                        </div>


                        <div class="tab-pane fade" id="messages">
                            <ul class="list">
                                <?php
                                $a = $this->connect->gettraixinh();
                                foreach ($a as $i) {
                                    $anh = $i->avarta;
                                    $id = $i->user_id;
                                    $ten = $i->name;
                                    ?>
                                    <a class="open" href="<?php echo base_url('getID?id=' . $id); ?>" class="goiy2"  data-toggle="tooltip" data-placement="top" title="<?php echo $ten; ?>" >

                                        <li class ="listjoin">
                                            <img class= "one anhnho6 img-thumbnail"  src="http://localhost:8080/nfa/images/avarta/<?php echo $anh; ?> "/>
                                        </li>
                                    </a>
                                    <?php
                                }
                                ?>
                            </ul>
                        </div>
                        <div class="tab-pane fade" id="settings">
                            <ul class="list">
                                <?php
                                $a = $this->connect->getgaidep();
                                foreach ($a as $i) {
                                    $anh = $i->avarta;
                                    $id = $i->user_id;
                                    $ten = $i->name;
                                    ?>
                                    <a class="open" href="<?php echo base_url('getID?id=' . $id); ?>" class="goiy2" data-toggle="tooltip" data-placement="top" title="<?php echo $ten; ?>" >

                                        <li class ="listjoin">
                                            <img class= "one anhnho6 img-thumbnail"  src="http://localhost:8080/nfa/images/avarta/<?php echo $anh; ?> "/>
                                        </li>
                                    </a>

                                    <?php
                                }
                                ?>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <footer >
            <div style="  color:#FFFBF0;">
                <address>
                    <strong>NFA</strong><br>
                        ©Copyright T2L group, 2014<br>

                            <abbr title="Phone">P:</abbr> (123) 456-7890
                            </address>
                            </div>
                            </footer>




                            </body>
                            </html>
